﻿namespace Proto
{
    using System;
    using System.Collections.Generic;

    using Proto.Fields;
    using Proto.Providers;

    public interface ISub<T> : IRequiresService where T : class, IFieldGetter
    {
        IKey SubscriptionKey { get; }
        SubState CurrentState { get; }

        void EnqueueBatchAddition(IEnumerable<T> update_list);
        void EnqueueBatchRemoval(IEnumerable<T> update_list);

        void EnqueueClear();

        void EnqueueAddition( T update );
        void EnqueueRemoval( T update );
        void EnqueueUpdate(T update);
        
        event ChangePending<SubItem<T>> NotifyAdditionPending;
        event ChangePending<SubItem<T>> NotifyRemovalPending;

        event Action NotifyClearPending;
    }
}